#include<stdio.h>

  int main()
  {
      int sum1=0,sum2=0,n,n1=0,n2=0,n3=0;
      while(1){
        scanf("%d",&n);
        if(n==-1) break;

        if(n<0)
            {n1=n1+1;
            sum1=sum1+n;}
        else if(n>0)
           {
             sum2=sum2+n;
             n2=n2+1;}
         else
            n3=n3+1;

      }
         printf("%d %d %d\n",n2,n3,n1);
         printf("%d %d\n",sum2,sum1);
         return 0;
  }
